package com.brain.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;

public class ConnectActivity extends Activity {
	private int imageIndex = 0;
	private int stop = 0;
	private Handler mHandler = new Handler();
	private Intent intent;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.connect);
	    intent = getIntent();
		mHandler.removeCallbacks(mUpdateTimeTask);
		mHandler.postDelayed(mUpdateTimeTask, 100);
		
		stop = 1;
		if(intent.getStringExtra("TYPE").equals("BRAIN_VIEW")) {
		    Intent intent =  new Intent(ConnectActivity.this, BodyMeasurementActivity.class);
		    startActivity(intent);
		} else {
		    Intent intent =  new Intent(ConnectActivity.this, HealingGameActivity.class);
		    startActivity(intent);
			
		}
		finish();

   }
    
    
	private Runnable mUpdateTimeTask = new Runnable() 
	{   
		@Override
		public void run() 
		{   
			if(stop == 1)
			{
				mHandler.sendEmptyMessage(0);
			}
			else
			{
				mHandler.postDelayed(mUpdateTimeTask, 100);
			}
		}
	};
    
}
